<include file="Public:head_nosearch" />
	<main>
		<form method="post" action="{:U('zhan/modify')}" id="mloginbox" enctype="multipart/form-data" >
			<div class="user-bg">
				<div class="nav">
					<a href="javascript:history.go(-1);" class="iconfont tqk-fanhui back"></a>
					<h3>个人设置</h3>
				</div>
				<div class="panel-wrap">
					<div class="panel avatar">
						<p>头像</p>
						<div class="am-form-group am-form-file am-margin-0" id="clipArea">
							<img src="{$info.avatar|default="__STATIC__/images/default_photo.gif"}" id="input-image">
							<i class="iconfont icon-right"></i>
							<input type="file" name="avatar" class="input-file">
						</div>
					</div>
				</div>
			</div>
			<div class="am-container">
				<div class="input-box">
					<div class="input-row">
				        <label>手机号</label>
				        <div class="formControls">
				        	<p>{$info.phone}</p>
				        </div>
				    </div>	
				    <div class="input-row">
				        <label>真实姓名</label>
				        <div class="formControls">
				        	<p>{$info.name}</p>
				        </div>
				    </div>	
				    <div class="input-row">
				        <label>支付宝</label>
				        <div class="formControls">
				        	<p>{$info.alipay}</p>
				        </div>
				    </div>	
					<div class="input-row">
				        <label>昵称</label>
				        <div class="formControls">
				    		<input type="text" class="input-text" name="nickname" value="{$info.nickname}">
				    	</div>
				    </div>	
				    <div class="input-row">
				        <label>QQ</label>
				        <div class="formControls">
				    		<input type="text" class="input-text" name="qq" value="{$info.qq}">
				    	</div>
				    </div>	
				    <div class="input-row">
				        <label>微信号</label>
				        <div class="formControls">
				    		<input type="text" class="input-text" name="wechat" value="{$info.wechat}">
				    	</div>
				    </div>	
				</div>
				<div class="input-box">
				    <div class="input-row">
				        <label>新密码</label>
				        <div class="formControls">
				    		<input type="password" id="password" class="input-text" name="password">
				    	</div>
				    </div>	
				    <div class="input-row">
				        <label>确认密码</label>
				        <div class="formControls">
				    		<input type="password" class="input-text" name="password2">
				    	</div>
				    </div>	
				</div>
				<button type="submit" id="btn" class="am-btn btn-main am-btn-block am-radius">确认提交</button>
			</div>
		</form>
	</main>
<include file="Public:foot" />
<script type="text/javascript" src="__STATIC__/wap/js/preview.js"></script>
<script>
	$(function() {
		$("input[name=avatar]").uploadPreview({
			Img: "input-image",
			Width: 20,
			Height: 20
		});
		$("#mloginbox").validate({
			rules: {
				password2: {
					equalTo: "#password",
				}
			},
			messages: {
				password2: {
					equalTo: "两次密码输入不一致",
				}
			},
			submitHandler: function(form) {
				$("#btn").html('数据保存中...');
				$('#btn').attr('disabled', "true");
	
				$(form).ajaxSubmit({
					success: function(json) {
						$("#btn").html('确认提交');
						$('#btn').removeAttr("disabled");
						if(json.status == 1) {
							layer.msg(json.msg, {
								icon: 6
							});
							setTimeout(function() {
								location.reload()
							}, 1000);
						} else {
							layer.msg(json.msg, {
								icon: 5,
								time: 1000
							});
						}
					}
				});
			}
		});
	});
</script>
</body></html>
